<?php


namespace App\Web\Controller;

use App\Web\Facades\UserAuth;

/**
 * 控制器基类
 * @package App\Web\Controller
 */
abstract class Controller extends BaseController {

    public function __construct() {
        parent::__construct();
        UserAuth::chkLogin();
        if (!($this->getCurrentController() == Operator::class && $this->getCurrentAction() == 'getinfo')
            && !($this->getCurrentController() == Operator::class && $this->getCurrentAction() == 'bindphone')
            && !($this->getCurrentController() == Operator::class && $this->getCurrentAction() == 'sendphoneauthcode')
            && !($this->getCurrentController() == Operator::class && $this->getCurrentAction() == 'resetpwd')
        ) {
            UserAuth::chkBindPhone();
        }

        if (!($this->getCurrentController() == Operator::class && $this->getCurrentAction() == 'resetpwd')) {
            UserAuth::chkForceModifyPwd();
        }

    }
}